<%--
  Created by IntelliJ IDEA.
  User: Saul.J.Wu
  Date: 2018/7/24
  Time: 17:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>Title</title>
    <%--引入 JQuery--%>
    <script src="js/jquery1.42.min.js"></script>
    <script>
        function expotExcelAll() {
            $.ajax({
                type: 'get',
                url: 'excelExportAll',
                success: function (data) {
                    if (data == 'ok') {
                        alert('导出成功');
                    }
                },
                error: function () {
                    alert('导出失败');
                }
            });
        }
    </script>
</head>
<body>
    <form action="excelImport.action" method="post" enctype="multipart/form-data">
        <input type="file" name="excel">
        <input type="submit" value="导入">
    </form>
    <table border="1" width="100%">
        <tr>
            <th>id</th><th>name</th>
        </tr>
        <c:forEach var="users" items="${userlist}">
            <tr>
                <td>
                        ${users.id}
                </td>
                <td>
                        ${users.remarks}
                </td>
            </tr>
        </c:forEach>
    </table>
    <p><input type="button" value="导出" onclick="expotExcelAll()"></p>
</body>
</html>
